(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/sales/detail"], {
        2356: function (e, t, o) {
            "use strict";
            o.r(t);
            var n = o("95a4"),
                a = o.n(n);
            for (var i in n)["default"].indexOf(i) < 0 && function (e) {
                o.d(t, e, (function () {
                    return n[e]
                }))
            }(i);
            t["default"] = a.a
        },
        "4a44": function (e, t, o) {
            "use strict";
            o.r(t);
            var n = o("5d1c"),
                a = o("2356");
            for (var i in a)["default"].indexOf(i) < 0 && function (e) {
                o.d(t, e, (function () {
                    return a[e]
                }))
            }(i);
            o("7d4f");
            var u = o("f0c5"),
                s = Object(u["a"])(a["default"], n["b"], n["c"], !1, null, "2edd8d05", null, !1, n["a"], void 0);
            t["default"] = s.exports
        },
        "5d1c": function (e, t, o) {
            "use strict";
            o.d(t, "b", (function () {
                return a
            })), o.d(t, "c", (function () {
                return i
            })), o.d(t, "a", (function () {
                return n
            }));
            var n = {
                    uniForms: function () {
                        return Promise.all([o.e("common/vendor"), o.e("components/uni-forms/uni-forms")]).then(o.bind(null, "0933"))
                    },
                    uniFormsItem: function () {
                        return o.e("components/uni-forms-item/uni-forms-item").then(o.bind(null, "4828"))
                    },
                    uniEasyinput: function () {
                        return Promise.all([o.e("common/vendor"), o.e("components/uni-easyinput/uni-easyinput")]).then(o.bind(null, "5dad"))
                    },
                    uniSwipeAction: function () {
                        return o.e("components/uni-swipe-action/uni-swipe-action").then(o.bind(null, "e7b4"))
                    },
                    uniSwipeActionItem: function () {
                        return Promise.all([o.e("common/vendor"), o.e("components/uni-swipe-action-item/uni-swipe-action-item")]).then(o.bind(null, "c498"))
                    },
                    uniPopup: function () {
                        return Promise.all([o.e("common/vendor"), o.e("components/uni-popup/uni-popup")]).then(o.bind(null, "666d"))
                    },
                    uniPopupDialog: function () {
                        return o.e("components/uni-popup-dialog/uni-popup-dialog").then(o.bind(null, "92b2"))
                    }
                },
                a = function () {
                    var e = this.$createElement;
                    this._self._c
                },
                i = []
        },
        "76fe": function (e, t, o) {},
        "7d4f": function (e, t, o) {
            "use strict";
            var n = o("76fe"),
                a = o.n(n);
            a.a
        },
        "95a4": function (e, t, o) {
            "use strict";
            (function (e) {
                var n = o("4ea4");
                Object.defineProperty(t, "__esModule", {
                    value: !0
                }), t.default = void 0;
                var a = n(o("2eee")),
                    i = n(o("c973")),
                    u = {
                        components: {
                            dtSelect: function () {
                                o.e("components/dt-select/dt-select").then(function () {
                                    return resolve(o("9fbf"))
                                }.bind(null, o)).catch(o.oe)
                            },
                            uniPopupDialog: function () {
                                o.e("components/uni-popup-dialog/uni-popup-dialog").then(function () {
                                    return resolve(o("92b2"))
                                }.bind(null, o)).catch(o.oe)
                            }
                        },
                        data: function () {
                            return {
                                url: getApp().globalData.apiurl,
                                dj: 0,
                                listData: [],
                                models: {
                                    customerno: "",
                                    weight: "",
                                    amountofmoney: "",
                                    approver2: ""
                                },
                                model: {},
                                checkStatus: 0,
                                checkNotes: "",
                                token: "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjE4NWFlMDkwLWQ0YzYtNDRmNi1iZjAyLWFiZjg2ZjA0MDIzZSJ9.THq92XxTBTkE-7JYoVmmNNhrHj4mbgGvQIwQg2TOYCDxfdD22uDx8OLV9vkT1pwNsoecIkttbhPCYTA4Iu0hFg"
                            }
                        },
                        methods: {
                            initData: function (t) {
                                var o = this;
                                return (0, i.default)(a.default.mark((function n() {
                                    var i;
                                    return a.default.wrap((function (n) {
                                        while (1) switch (n.prev = n.next) {
                                            case 0:
                                                i = o, console.log("销售单id", t), null != t && e.request({
                                                    url: o.url + "salesdocuments/salesdocuments/selectSalesdocumentsByIdApp/" + t,
                                                    method: "get",
                                                    header: {
                                                        Authorization: o.token
                                                    },
                                                    data: {
                                                        id: t
                                                    },
                                                    success: function (n) {
                                                        i.model = n.data.data, i.models.customerno = n.data.data.customerName, i.models.weight = n.data.data.weight, i.models.amountofmoney = n.data.data.amountofmoney, i.models.approver2 = n.data.data.approver2, o.dj = i.model.amountofmoney / i.model.weight, e.request({
                                                            url: o.url + "sale/product/list",
                                                            method: "GET",
                                                            data: {
                                                                orderid: t
                                                            },
                                                            success: function (t) {
                                                                o.listData = t.data.rows, e.request({
                                                                    url: o.url + "goodsmaintain/goods/list",
                                                                    method: "GET",
                                                                    data: {
                                                                        type: "2"
                                                                    },
                                                                    success: function (e) {
                                                                        e.data.rows
                                                                    },
                                                                    fail: function () {},
                                                                    complete: function () {}
                                                                })
                                                            }
                                                        }), e.request({
                                                            url: o.url + "salesdocuments/salesdocuments/selectSalesdocumentsByIdApp/" + t,
                                                            method: "get",
                                                            header: {
                                                                Authorization: o.token
                                                            },
                                                            data: {
                                                                id: t
                                                            },
                                                            success: function (e) {
                                                                i.model = e.data.data
                                                            }
                                                        })
                                                    }
                                                });
                                            case 3:
                                            case "end":
                                                return n.stop()
                                        }
                                    }), n)
                                })))()
                            },
                            checkPass: function () {
                                var t = this,
                                    o = this;
                                this.checkStatus = 1;
                                getApp().globalData.userinfo.roles[0].roleKey;
                                var n = getApp().globalData.userinfo.nickName;
                                o.token = getApp().globalData.userinfo.loginIp, e.request({
                                    url: this.url + "salesdocuments/salesdocuments",
                                    method: "PUT",
                                    header: {
                                        Authorization: o.token
                                    },
                                    data: {
                                        id: o.model.id,
                                        customerno: o.model.customerId,
                                        unitprice: o.model.unitPrice,
                                        weight: o.model.weight,
                                        amountofmoney: o.model.totalPrice,
                                        goodsno: o.model.goodId,
                                        maintainpeople: n,
                                        state: 1
                                    },
                                    success: function (n) {
                                        e.request({
                                            url: t.url + "outboundorder/outboundorder",
                                            method: "POST",
                                            header: {
                                                Authorization: t.token
                                            },
                                            data: {
                                                salesdocumentsno: o.model.id,
                                                issue: o.model.weight
                                            },
                                            success: function (e) {
                                                t.spMessagePush("销售单审批已通过", o.model.id), t.kfMessagePush(o.model.id), o.model = e.data.data
                                            }
                                        })
                                    }
                                }), e.showToast({
                                    title: "审核成功"
                                }), setTimeout((function () {
                                    e.redirectTo({
                                        url: "/pages/main/sales/audit"
                                    })
                                }), 1000)
                            },
                            checkBack: function () {
                                this.$refs.checkBackDialog.open()
                            },
                            checkBackConfirm: function (t, o) {
                                var n = this;
                                if (o) {
                                    var a = e.getStorageSync("key"),
                                        i = (a.userRoles, getApp().globalData.userinfo.nickName),
                                        u = this;
                                    u.token = getApp().globalData.userinfo.loginIp, this.checkStatus = -1, this.checkNotes = o, e.request({
                                        url: this.url + "salesdocuments/salesdocuments",
                                        method: "PUT",
                                        header: {
                                            Authorization: u.token
                                        },
                                        data: {
                                            id: u.model.id,
                                            customerno: u.model.customerId,
                                            unitprice: u.model.unitPrice,
                                            weight: u.model.weight,
                                            amountofmoney: u.model.totalPrice,
                                            goodsno: u.model.goodId,
                                            maintainpeople: i,
                                            remarks: this.checkNotes,
                                            state: 3
                                        },
                                        success: function (t) {
                                            n.spMessagePush("销售单审已驳回", u.model.id), setTimeout((function () {
                                                e.redirectTo({
                                                    url: "/pages/main/sales/audit"
                                                })
                                            }), 300), n.$refs.checkBackDialog.close()
                                        }
                                    })
                                } else e.showToast({
                                    icon: "error",
                                    title: "请输入驳回理由"
                                })
                                
                            },
                            spMessagePush: function (e, t) {
                                getApp().globalData.appPushInfo("审批角色通知提交人", t, e, "您提交的销售单已审批！", "", getApp().globalData.getId())
                            },
                            kfMessagePush: function (t) {
                                var o = [];
                                e.request({
                                    url: this.url + "appLoginRedis/getSaleUserList",
                                    method: "GET",
                                    data: {
                                        dictLabel: "库房角色权限字符"
                                    },
                                    success: function (e) {
                                        console.log("查询得到权限字符：", e.data), e.data.forEach((function (e) {
                                            o.push(e.nickName)
                                        }))
                                    },
                                    complete: function () {
                                        getApp().globalData.appPushInfo("审批角色通知库房人员", o, "出库通知", "您有新的出库单需要出库！", "", getApp().globalData.getId())
                                    }
                                })
                            }
                        },
                        onLoad: function (e) {
                            e.id && this.initData(e.id)
                        }
                    };
                t.default = u
            }).call(this, o("543d")["default"])
        },
        e817: function (e, t, o) {
            "use strict";
            (function (e, t) {
                var n = o("4ea4");
                o("c150"), o("5c17"), o("a9ff");
                n(o("66fd"));
                var a = n(o("4a44"));
                e.__webpack_require_UNI_MP_PLUGIN__ = o, t(a.default)
            }).call(this, o("bc2e")["default"], o("543d")["createPage"])
        }
    },
    [
        ["e817", "common/runtime", "common/vendor"]
    ]
]);